package Day26;

public class Personn {
    public static void main(String[] args) {
        PPerson p1 = new PPerson("小韩",23);
        Student s1 = new Student("小周",34,01,67.5);
        System.out.println(p1.say());
        System.out.println(s1.say());

    }
}

class PPerson{
    private String name;
    private int age;

    public PPerson(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public PPerson() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public String say(){
        return "name = " + name + ", age = "+ age;
    }
}

class Student extends PPerson{
    private int id;
    private double score;
    public Student(String name, int age, int id, double score) {
        super(name, age);
        this.id = id;
        this.score = score;
    }

    public Student(int id, double score) {
        this.id = id;
        this.score = score;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public Student(int id) {
        this.id = id;
    }

    @Override
    public String say() {
        return super.say() + " id = "+ id + ", score = " + score;
    }
}
